#pragma warning( disable : 4996 4100 4127 )

#ifndef _GLOBAL_H_
#define _GLOBAL_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_TOKEN_LEN 256
#define MAX_FN_LEN 256
// const, int, float, char, void, main
// if, else, for, while, return
// scanf, printf
#define RESERVED_NUM  13

#define F_TOKENTYPE     0
#define F_CLASS         100
#define F_TYPE          200
#define F_OPCODE        300
#define F_OPERANDTYPE   400
#define F_CONTTYPE      500
#define F_REGSTATE      600

typedef enum Bool {
    FALSE, TRUE,
} Bool;

typedef enum TokenType {
    IDENT = F_TOKENTYPE,                                                      /* 0     */          // Identifier,
    PLUS, MINUS, TIMES, SLASH,                                                /* 1-4   */          // +, -, *, /,
    ASSIGN,                                                                   /* 5     */          // =
    LSS, LEQ, GTR, GEQ, NEQ, DEQ,                                             /* 6-11  */          // <, <=, >, >=, !=, ==,
    COMMA, PERIOD, SEMICOLON, L_CURLY_BRACE, R_CURLY_BRACE,                   /* 12-16 */          // ,, ., ;, {, }, 
    LPAREN, RPAREN,                                                           /* 17-18 */          // (, ), 
    C_STR, C_INT, C_FLOAT, C_CHAR,                                            /* 19-22 */          // constant string, integer, float, character,
    CONST, INT, FLOAT, CHAR,                                                                       // const, int, float, char, void, 
    IF, ELSE, FOR, WHILE,                                                                          // if, else, for, while,
    SCANF, PRINTF,                                                                                 // scanf, printf, 
    VOID, MAIN, RETURN,                                                                            // main, return,
    ENDOFFILE, ERROR,                                                                              // EOF, error token,
} TokenType;

extern Bool DEBUG;
extern Bool ERRORED;

extern FILE *source;
extern FILE *error;
extern FILE *dbgout;
extern FILE *asmout;

#endif
